package com.controller.medical;

import com.comm.R;
import com.comm.vo.medicinevo.DrugAllView;
import com.comm.vo.medicinevo.DrugBillView;
import com.entity.DrugOrder;
import io.swagger.annotations.*;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/medicine/purchase")
@Api(value = "药品进销存模块",tags = "采购入库的所有接口API")
@ApiResponses({
        @ApiResponse(code=200,message="请求成功"),
        @ApiResponse(code=404,message="找不到页面"),
        @ApiResponse(code=405,message="请求方法错误"),
        @ApiResponse(code=500,message="后台服务错误")
})
public class PurchaseController {

    //查询药品信息(添加药品按钮)
    @RequestMapping(value = "/findDrugList", method = RequestMethod.GET)
    @ApiOperation(value = "添加查询药品信息接口", notes = "传递信息", httpMethod = "post", response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "currentPage",value = "当前页",paramType = "query",dataType = "String",required = true),
            @ApiImplicitParam(name = "pageSize",value = "每页的条数",paramType = "query",dataType = "String",required = true),
            @ApiImplicitParam(name = "drugName", value = "药品名称", paramType = "query", dataType = "String", required = false),
            @ApiImplicitParam(name = "classify", value = "药品分类", paramType = "query", dataType = "String", required = false)
    })

    public String findDrugList(@ApiParam() String currentPage,String pageSize,String drugName, String classify) {
        return "{\n" +
                "\t\"id\": dzm0051\n" +
                "\t\"drug_name\": \"烫骨碎补\",\n" +
                "\t\"remark\": \"g\",\n" +
                "\t\"drug_factory\":\"a药厂\",\n" +
                "}";
    }

    //查询所有供应商名称
    @RequestMapping(value = "/findAllSupName", method = RequestMethod.GET)
    @ApiOperation(value = "查询所有供应商名称", notes = "查询所有供应商名称", httpMethod = "GET", response = R.class)
    public R findSupName() {
        R r = new R();
        r.setCode(200);
        r.setMsg("查询成功！");
        return  r;
    }

    //提交审核按钮
    @RequestMapping(value = "/SubmitCheck",method = RequestMethod.POST)
    @ApiOperation(value = "提交审核",notes = "提交审核",httpMethod = "POST", response = R.class)
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "id",value = "药品编号",paramType = "query",dataType = "String",required = false),
//            @ApiImplicitParam(name = "drugName",value = "药品名称",paramType = "query",dataType = "String",required = false),
//            @ApiImplicitParam(name = "number",value = "数量",paramType = "query",dataType = "int",required = false),
//            @ApiImplicitParam(name = "remark",value = "单位",paramType = "query",dataType = "String",required = false),
//            @ApiImplicitParam(name = "createDate",value = "创建时间",paramType = "query",dataType = "timestamp",required = false),
//            @ApiImplicitParam(name = "classify",value = "药品分类",paramType = "query",dataType = "String",required = false),
//            @ApiImplicitParam(name = "sepc",value = "规格",paramType = "query",dataType = "String",required = false),
//            @ApiImplicitParam(name = "drugFactory",value = "生产厂家",paramType = "query",dataType = "String",required = false)
//    })
    @ResponseBody
    public R SubmitCheck(@RequestBody @ApiParam(name = "drugBillView",value = "订单实体",required = true)DrugBillView drugBillView) {
        R r = new R();
        r.setCode(200);
        r.setMsg("添加成功！");
        return r;
    }

    //直接入库按钮
    @RequestMapping(value = "/inStock", method = RequestMethod.POST)
    @ApiOperation(value = "直接入库", notes = "直接入库", httpMethod = "post", response = R.class)
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "checker",value = "审核人",paramType = "query",dataType = "String",required = true),
//            @ApiImplicitParam(name = "checkTime",value = "审核日期",paramType = "query",dataType = "String",required = true),
//            @ApiImplicitParam(name = "status", value = "状态", paramType = "query", dataType = "String", required = false),
//            @ApiImplicitParam(name = "classify", value = "药品名称", paramType = "query", dataType = "String", required = false)
//
//    })

    @ResponseBody
    public R inStock(@RequestBody @ApiParam(name = "drugAllView",value = "订单实体",required = true)DrugAllView drugAllView) {
        R r = new R();
        r.setCode(200);
        r.setMsg("添加成功！");
        return r;
    }


}
